import * as qiniu from "qiniu-js";
class QiniuUpload {
  constructor() {}

  upload(file, key, token, putExtra, config) {
    let observable = qiniu.upload(file, key, token, putExtra, config);
    var subscription = observable.subscribe(next, error, complete);
  }
  beginUpload(res) {
    console.log("开始上传");
    console.log("当前进度：" + res.total.percent);
  }
  errorUpload(err) {
    console.log("上传中出现错误");
    if (!err.isRequestError) {
      console.error(err.message);
    }
  }
  completeUpload(res) {
    console.log("上传完成");
  }
}
export default QiniuUpload;
